package com.qingcloud.base.pojo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * 分页实体类
 */
@Data
@Builder
@AllArgsConstructor
public class PageResult<T> implements Serializable {

    private static final long serialVersionUID = -275582248840137389L;

    public PageResult() {
        this.code = 0;
        this.count = 0L;
        this.data = Collections.emptyList();
    }

    /**
     * 总数
     */
    private Long count;
    /**
     * 是否成功：0 成功、1 失败
     */
    private int code;
    /**
     * 当前页结果集
     */
    private List<T> data;

}
